Relatório de Análise de Séries Temporais

## 
## Attaching package: 'zoo'
## 
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## 
## This is forecast 5.6 
## 
## locfit 1.5-9.1    2013-03-22
## Loading required package: nlme
## 
## Attaching package: 'nlme'
## 
## The following object is masked from 'package:forecast':
## 
##     getResponse
## 
## This is mgcv 1.8-3. For overview type 'help("mgcv-package")'.

Este relatório tem como objecto de análise

Dados originais:

##        Jan   Feb   Mar   Apr   May   Jun   Jul   Aug   Sep   Oct   Nov
## 1956  1709  1646  1794  1878  2173  2321  2468  2416  2184  2121  1962
## 1957  1751  1688  1920  1941  2311  2279  2638  2448  2279  2163  1941
## 1958  1773  1688  1783  1984  2290  2511  2712  2522  2342  2195  1931
## 1959  1730  1688  1899  1994  2342  2553  2712  2627  2363  2311  2026
## 1960  1762  1815  2005  2089  2617  2828  2965  2891  2532  2363  2216
## 1961  1804  1773  2015  2089  2627  2712  3007  2880  2490  2237  2205
## 1962  1868  1815  2047  2142  2743  2775  3028  2965  2501  2501  2131
## 1963  1910  1868  2121  2268  2690  2933  3218  3028  2659  2406  2258
## 1964  1889  1984  2110  2311  2785  3039  3229  3070  2659  2543  2237
## 1965  1962  1910  2216  2437  2817  3123  3345  3112  2659  2469  2332
## 1966  1910  1941  2216  2342  2923  3229  3513  3355  2849  2680  2395
## 1967  1994  1952  2290  2395  2965  3239  3608  3524  3018  2648  2363
## 1968  1994  1941  2258  2332  3323  3608  3957  3672  3155  2933  2585
## 1969  2057  2100  2458  2638  3292  3724  4652  4379  4231  3756  3429
## 1970  3345  4220  4874  5064  5951  6774  7997  7523  7438  6879  6489
## 1971  5919  6183  6594  6489  8040  9715  9714  9756  8595  7861  7753
## 1972  7778  7402  8903  9742 11372 12741 13733 13691 12239 12502 11241
## 1973 11569 10397 12493 11962 13974 14945 16805 16587 14225 14157 13016
## 1974 11704 12275 13695 14082 16555 17339 17777 17592 16194 15336 14208
## 1975 12354 12682 14141 14989 16159 18276 19157 18737 17109 17094 15418
## 1976 13260 14990 15975 16770 19819 20983 22001 22337 20750 19969 17293
## 1977 15117 16058 18137 18471 21398 23854 26025 25479 22804 19619 19627
## 1978 17243 18284 20226 20903 23768 26323 28038 26776 22886 22813 22404
## 1979 18839 18892 20823 22212 25076 26884 30611 30228 26762 25885 23328
## 1980 21433 22369 24503 25905 30605 34984 37060 34502 31793 29275 28305
## 1981 27730 27424 32684 31366 37459 41060 43558 42398 33827 34962 33480
## 1982 30715 30400 31451 31306 40592 44133 47387 41310 37913 34355 34607
## 1983 26138 30745 35018 34549 40980 42869 45022 40387 38180 38608 35308
## 1984 28801 33034 35294 33181 40797 42355 46098 42430 41851 39331 37328
## 1985 32494 33308 36805 34221 41020 44350 46173 44435 40943 39269 35901
## 1986 31239 32261 34951 38109 43168 45547 49568 45387 41805 41281 36068
## 1987 32791 34206 39128 40249 43519 46137 56709 52306 49397 45500 39857
## 1988 35567 37696 42319 39137 47062 50610 54457 54435 48516 43225 42155
## 1989 37541 37277 41778 41666 49616 57793 61884 62400 50820 51116 45731
## 1990 40459 40295 44147 42697 52561 56572 56858 58363 45627 45622 41304
## 1991 35592 35677 39864 41761 50380 49129 55066 55671 49058 44503 42145
## 1992 38963 38690 39792 42545 50145 58164 59035 59408 55988 47321 42269
## 1993 37059 37963 31043 41712 50366 56977 56807 54634 51367 48073 46251
## 1994 39975 40478 46895 46147 55011 57799 62450 63896 57784 53231 50354
## 1995 41600 41471 46287 49013 56624 61739 66600 60054                  
##        Dec
## 1956  1825
## 1957  1878
## 1958  1910
## 1959  1910
## 1960  2026
## 1961  1984
## 1962  2015
## 1963  2057
## 1964  2142
## 1965  2110
## 1966  2205
## 1967  2247
## 1968  2384
## 1969  3461
## 1970  6288
## 1971  8154
## 1972 10829
## 1973 12253
## 1974 13116
## 1975 14312
## 1976 16498
## 1977 18488
## 1978 19795
## 1979 21930
## 1980 25248
## 1981 32445
## 1982 28729
## 1983 30234
## 1984 34514
## 1985 32142
## 1986 34879
## 1987 37958
## 1988 39995
## 1989 42528
## 1990 36016
## 1991 38698
## 1992 39606
## 1993 43736
## 1994 38410
## 1995

plot of chunk unnamed-chunk-4

## Warning: p-value smaller than printed p-value
## Warning: p-value smaller than printed p-value
## Warning: p-value smaller than printed p-value
## Warning: p-value smaller than printed p-value

plot of chunk unnamed-chunk-5

An?lise de Sazonalidade

plot of chunk unnamed-chunk-6

plot of chunk unnamed-chunk-7

Sazonalidade - Autocorrela??o

plot of chunk unnamed-chunk-8

Seasonal Decomposition of Time Series by Loess

plot of chunk unnamed-chunk-10

Outros testes

McLeod-Li test for conditional heteroscedascity (ARCH)

plot of chunk unnamed-chunk-11

Proje??es

Space-State Model (ETS)

## ETS(M,Md,M) 
## 
## Call:
##  ets(y = d) 
## 
##   Smoothing parameters:
##     alpha = 0.6534 
##     beta  = 0.0282 
##     gamma = 1e-04 
##     phi   = 0.98 
## 
##   Initial states:
##     l = 2085.0093 
##     b = 0.9965 
##     s=0.8476 0.919 1.004 1.072 1.206 1.264
##            1.176 1.093 0.9198 0.8936 0.8085 0.7973
## 
##   sigma:  0.0486
## 
##  AIC AICc  BIC 
## 8991 8992 9062 
## 
## Training set error measures:
##                 ME RMSE   MAE    MPE  MAPE   MASE    ACF1
## Training set 10.56 1454 791.2 0.1444 3.536 0.4582 -0.1029
## 
## Forecast method: ETS(M,Md,M)
## 
## Model Information:
## ETS(M,Md,M) 
## 
## Call:
##  ets(y = d) 
## 
##   Smoothing parameters:
##     alpha = 0.6534 
##     beta  = 0.0282 
##     gamma = 1e-04 
##     phi   = 0.98 
## 
##   Initial states:
##     l = 2085.0093 
##     b = 0.9965 
##     s=0.8476 0.919 1.004 1.072 1.206 1.264
##            1.176 1.093 0.9198 0.8936 0.8085 0.7973
## 
##   sigma:  0.0486
## 
##  AIC AICc  BIC 
## 8991 8992 9062 
## 
## Error measures:
##                 ME RMSE   MAE    MPE  MAPE   MASE    ACF1
## Training set 10.56 1454 791.2 0.1444 3.536 0.4241 -0.1029
## 
## Forecasts:
##          Point Forecast Lo 80  Hi 80 Lo 95  Hi 95
## Sep 1995          54570 51250  57983 49382  59959
## Oct 1995          51150 47388  55031 45311  57265
## Nov 1995          46882 42802  51046 40834  53354
## Dec 1995          43284 39023  47654 36971  50023
## Jan 1996          40760 36333  45289 34194  47937
## Feb 1996          41378 36432  46552 34113  49238
## Mar 1996          45775 39832  52095 37213  55513
## Apr 1996          47167 40595  54192 37756  57978
## May 1996          56089 47982  64957 44263  70481
## Jun 1996          60426 51069  70558 46935  76422
## Jul 1996          64992 54373  76825 49580  83583
## Aug 1996          62055 51299  73779 46534  81397
## Sep 1996          55226 45079  66182 40887  73013
## Oct 1996          51753 41879  62514 37712  69608
## Nov 1996          47424 37966  57824 34091  64037
## Dec 1996          43774 34793  53785 30859  59814
## Jan 1997          41212 32415  51084 28543  57173
## Feb 1997          41827 32559  52356 28589  59332
## Mar 1997          46263 35446  58339 31219  66266
## Apr 1997          47659 36213  60616 31580  68563
## May 1997          56663 42529  72835 37129  83153
## Jun 1997          61032 45671  79329 39019  90709
## Jul 1997          65630 48496  85521 41636  98709
## Aug 1997          62652 45941  82543 39025  95522
## Sep 1997          55747 40570  74218 34238  86220
## Oct 1997          52232 37450  70008 31575  81784
## Nov 1997          47853 34072  64767 28646  76419
## Dec 1997          44163 31034  60059 26029  71456
## Jan 1998          41571 28888  57166 24273  67855
## Feb 1998          42184 28886  58615 23922  69175
## Mar 1998          46649 31791  65678 26133  78073
## Apr 1998          48049 32489  67905 26257  81357
## May 1998          57117 38482  81543 30966  98565
## Jun 1998          61511 40769  88853 32783 107891
## Jul 1998          66135 43268  95828 34796 117632
## Aug 1998          63125 40975  92456 32560 113792
## Sep 1998          56159 36258  82700 28776 102395
## Oct 1998          52610 33430  77667 26212  96821
## Nov 1998          48193 30462  71923 23845  90471
## Dec 1998          44470 27607  66952 21947  84037
## Jan 1999          41854 25809  63416 20084  80557
## Feb 1999          42466 25860  64735 20050  81791
## Mar 1999          46954 28427  72499 22016  92299
## Apr 1999          48358 28879  74884 22097  97082
## May 1999          57476 34274  89501 26226 117624
## Jun 1999          61890 35970  97961 27843 126641
## Jul 1999          66535 38557 106072 29392 138773
## Aug 1999          63499 36662 102112 27725 133937
## Sep 1999          56485 32223  91597 24262 120610
## Oct 1999          52909 29857  86602 22563 114126
## Nov 1999          48461 27035  79949 20268 105409
## Dec 1999          44713 24714  74053 18457  99148

plot of chunk unnamed-chunk-12

plot of chunk unnamed-chunk-13

Arima - Pr? an?lise

Arima - Autocorrelation

plot of chunk unnamed-chunk-14

Arima - Partial Autocorrelation

plot of chunk unnamed-chunk-15

Arima - Proje??o

## 
##  ARIMA(2,1,2)(1,0,1)[12] with drift         : Inf
##  ARIMA(0,1,0) with drift         : 8882
##  ARIMA(1,1,0)(1,0,0)[12] with drift         : 8506
##  ARIMA(0,1,1)(0,0,1)[12] with drift         : 8695
##  ARIMA(1,1,0) with drift         : 8841
##  ARIMA(1,1,0)(2,0,0)[12] with drift         : 8456
##  ARIMA(1,1,0)(2,0,1)[12] with drift         : Inf
##  ARIMA(0,1,0)(2,0,0)[12] with drift         : 8523
##  ARIMA(2,1,0)(2,0,0)[12] with drift         : 8450
##  ARIMA(2,1,1)(2,0,0)[12] with drift         : 8422
##  ARIMA(3,1,2)(2,0,0)[12] with drift         : Inf
##  ARIMA(2,1,1)(2,0,0)[12]                    : 8420
##  ARIMA(2,1,1)(1,0,0)[12]                    : 8467
##  ARIMA(2,1,1)(2,0,1)[12]                    : Inf
##  ARIMA(1,1,1)(2,0,0)[12]                    : Inf
##  ARIMA(3,1,1)(2,0,0)[12]                    : Inf
##  ARIMA(2,1,0)(2,0,0)[12]                    : 8448
##  ARIMA(2,1,2)(2,0,0)[12]                    : 8421
##  ARIMA(1,1,0)(2,0,0)[12]                    : 8454
##  ARIMA(3,1,2)(2,0,0)[12]                    : Inf
## 
##  Best model: ARIMA(2,1,1)(2,0,0)[12]
## 
## Forecast method: ARIMA(2,1,1)(2,0,0)[12]                   
## 
## Model Information:
## Series: d 
## ARIMA(2,1,1)(2,0,0)[12]                    
## 
## Coefficients:
##         ar1    ar2     ma1   sar1   sar2
##       0.472  0.219  -0.956  0.554  0.352
## s.e.  0.061  0.058   0.035  0.046  0.046
## 
## sigma^2 estimated as 2807497:  log likelihood=-4210
## AIC=8431   AICc=8432   BIC=8456
## 
## Error measures:
##                 ME RMSE   MAE    MPE  MAPE  MASE     ACF1
## Training set 100.8 1674 955.2 0.7066 4.236 0.512 -0.01898
## 
## Forecasts:
##          Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
## Sep 1995          57436 55288 59583 54152 60720
## Oct 1995          53216 50801 55632 49522 56911
## Nov 1995          51148 48499 53796 47097 55198
## Dec 1995          43604 40823 46385 39351 47857
## Jan 1996          44065 41190 46941 39668 48463
## Feb 1996          44172 41229 47114 39671 48672
## Mar 1996          49107 46114 52100 44529 53685
## Apr 1996          50357 47324 53389 45718 54995
## May 1996          57701 54636 60766 53013 62389
## Jun 1996          61520 58427 64613 56790 66250
## Jul 1996          65855 62738 68971 61088 70621
## Aug 1996          62737 59599 65875 57938 67536
## Sep 1996          59132 55637 62628 53786 64479
## Oct 1996          55190 51567 58813 49649 60731
## Nov 1996          53029 49288 56771 47308 58751
## Dec 1996          44639 40814 48463 38790 50488
## Jan 1997          46019 42127 49912 40066 51972
## Feb 1997          46033 42085 49981 39995 52071
## Mar 1997          50466 46470 54462 44354 56577
## Apr 1997          52119 48081 56157 45943 58295
## May 1997          58872 54796 62949 52639 65106
## Jun 1997          62792 58681 66903 56505 69079
## Jul 1997          66908 62764 71051 60570 73245
## Aug 1997          62873 58698 67047 56488 69257
## Sep 1997          59952 55359 64545 52927 66977
## Oct 1997          56280 51526 61033 49010 63549
## Nov 1997          54353 49450 59257 46854 61852
## Dec 1997          47044 42031 52057 39377 54711
## Jan 1998          47972 42867 53076 40165 55779
## Feb 1998          48017 42835 53199 40092 55942
## Mar 1998          52213 46964 57462 44185 60241
## Apr 1998          53570 48260 58880 45450 61690
## May 1998          59901 54537 65266 51697 68106
## Jun 1998          63420 58004 68836 55136 71703
## Jul 1998          67229 61764 72694 58871 75587
## Aug 1998          63894 58382 69405 55465 72322
## Sep 1998          61004 55172 66837 52085 69924
## Oct 1998          57579 51600 63558 48435 66724
## Nov 1998          55750 49632 61869 46393 65108
## Dec 1998          48742 42514 54970 39217 58267
## Jan 1999          49742 43420 56065 40072 59413
## Feb 1999          49772 43366 56179 39975 59570
## Mar 1999          53661 47179 60142 43748 63573
## Apr 1999          54995 48444 61546 44976 65014
## May 1999          60885 54269 67501 50767 71003
## Jun 1999          64216 57539 70894 54004 74429
## Jul 1999          67778 61041 74514 57475 78080
## Aug 1999          64507 57714 71301 54117 74897
## Sep 1999          61876 54784 68968 51030 72723
## Oct 1999          58684 51442 65925 47609 69759
## Nov 1999          56991 49606 64376 45697 68285
## Dec 1999          50531 43030 58032 39059 62002

plot of chunk unnamed-chunk-16

Linear Model

plot of chunk unnamed-chunk-17

## 
## Call:
## lm(formula = d ~ time(d))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -16988  -5263  -1184   4830  19858 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -3.01e+06   5.04e+04   -59.6   <2e-16 ***
## time(d)      1.53e+03   2.55e+01    60.0   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6380 on 474 degrees of freedom
## Multiple R-squared:  0.884,  Adjusted R-squared:  0.883 
## F-statistic: 3.6e+03 on 1 and 474 DF,  p-value: <2e-16

plot of chunk unnamed-chunk-19

## Analysis of Variance Table
## 
## Response: d
##            Df   Sum Sq  Mean Sq F value Pr(>F)    
## time(d)     1 1.46e+11 1.46e+11    3603 <2e-16 ***
## Residuals 474 1.93e+10 4.06e+07                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Trend - Seazonal Linear Model

plot of chunk unnamed-chunk-21

## 
## Call:
## lm(formula = formula, data = "d", na.action = na.exclude)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -14888  -4144   -586   3949  15668 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -12909.11     994.61  -12.98  < 2e-16 ***
## trend          127.42       1.88   67.77  < 2e-16 ***
## season2        351.28    1260.19    0.28    0.781    
## season3       1885.52    1260.19    1.50    0.135    
## season4       2211.50    1260.20    1.75    0.080 .  
## season5       5704.76    1260.21    4.53  7.6e-06 ***
## season6       7552.62    1260.22    5.99  4.1e-09 ***
## season7       9243.11    1260.24    7.33  1.0e-12 ***
## season8       8164.92    1260.26    6.48  2.4e-10 ***
## season9       5321.77    1268.25    4.20  3.3e-05 ***
## season10      3946.18    1268.25    3.11    0.002 ** 
## season11      2299.22    1268.26    1.81    0.070 .  
## season12       456.53    1268.28    0.36    0.719    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5640 on 463 degrees of freedom
## Multiple R-squared:  0.911,  Adjusted R-squared:  0.909 
## F-statistic:  396 on 12 and 463 DF,  p-value: <2e-16
## Analysis of Variance Table
## 
## Response: d
##            Df   Sum Sq  Mean Sq F value Pr(>F)    
## trend       1 1.46e+11 1.46e+11  4610.9 <2e-16 ***
## season     11 4.56e+09 4.15e+08    13.1 <2e-16 ***
## Residuals 463 1.47e+10 3.18e+07                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

plot of chunk unnamed-chunk-24

Compara??o de Modelos

plot of chunk unnamed-chunk-25

Erros

plot of chunk unnamed-chunk-26

Residuos ETS

plot of chunk unnamed-chunk-27

Residuos ARIMA

plot of chunk unnamed-chunk-28

Residuos TSLM

plot of chunk unnamed-chunk-29